/*
 * @Author: xiaoxiao1872 zouxy1872@163.com
 * @Date: 2023-07-03
 * @LastEditors: xiaoxiao1872 zouxy1872@163.com
 * @LastEditTime: 2023-10-09
 * @FilePath: \saas-pc\src\store\types.ts
 */
import { Ref, UnwrapRef } from 'vue'
import { RouteRecordRaw } from 'vue-router'

export interface UserState {
  headerImage: string
  admin: boolean
  skin: string
  companyId: string
  companyName: string
  companyShortName: string
  deptId: string
  deptName: string
  id: string
  userName: string
  token: string
}
export enum LayoutMode {
  LTR = 'ltr',
  LCR = 'lcr',
  TTB = 'ttb',
}

export enum DeviceType {
  PC = 'pc',
  PAD = 'pad',
  MOBILE = 'mobile',
}

export enum ThemeMode {
  LIGHT = 'light',
  DARK = 'dark',
}

export enum SideTheme {
  DARK = 'dark',
  WHITE = 'white',
  BLUE = 'blue',
  IMAGE = 'image',
}

export enum PageAnim {
  FADE = 'fade',
  OPACITY = 'opacity',
  DOWN = 'down',
  SCALE = 'scale',
}

export interface AppConfigState {
  projectName: string
  theme: ThemeMode
  sideTheme: SideTheme
  themeColor: string
  layoutMode: LayoutMode
  deviceType: DeviceType
  sideWidth: number
  pageAnim: PageAnim
  isFixedNavBar: boolean
  isCollapse: boolean
  actionBar: {
    isShowSearch: boolean
    isShowMessage: boolean
    isShowRefresh: boolean
    isShowFullScreen: boolean
  }
}

export interface MenuOption {
  key: string | undefined
  label: string | undefined
  icon: string | undefined
  path?: string | undefined
  children: Array<MenuOption> | null
}

export interface SplitTab {
  label: string
  iconPrefix?: string | unknown
  icon: string
  fullPath: string
  children?: Array<RouteRecordRaw>
  checked: Ref<UnwrapRef<boolean>>
}

export interface OriginRoute {
  parentPath?: string //父级菜单路径
  menuUrl: string //菜单路径
  menuName?: string //菜单名称
  routeName?: string //路由名称
  hidden?: boolean //是否隐藏
  outLink?: string
  affix?: boolean //是否固定在顶部
  cacheable?: boolean //是否需要缓存
  isRootPath?: boolean
  iconPrefix?: string
  icon?: string //icon图标
  badge?: string | number
  isSingle?: boolean
  localFilePath?: string
  children?: Array<OriginRoute> //子菜单列表
  documentUrl?: string //说明文档地址
}
